#import "SearchService.h"
#import "SelectableModel.h"
#import "InfoBase.h"

typedef id(^ConvertFromDictionary)(NSDictionary* dictionary);

@interface Repository : NSObject

-(id)initWithSearchService:(SearchService*)aSearchService modelName:(NSString*)modelName getModelsSelector:(SEL)aGetModelsSelector getInfoSelector:(SEL)aGetInfoSelector convertFromDictionary:(ConvertFromDictionary)aConvertFromDictionary;
+(Repository*)repositoryWithSearchService:(SearchService*)aSearchService modelName:(NSString*)modelName getModelsSelector:(SEL)aGetModelsSelector getInfoSelector:(SEL)aGetInfoSelector convertFromDictionary:(ConvertFromDictionary)aConvertFromDictionary;
-(NSArray*)getModels:(BOOL)reload error:(NSError**)error;
-(id<SelectableModel>)getModelById:(NSString*)idModel error:(NSError**)error;
-(InfoBase*)getModelInfoById:(NSString*)idModel error:(NSError**)error;

@end
